package com.ztjy.utils;

import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 戴小军
 * @version 1.0
 * @date 2020/6/7 22:52
 * SpringBoot自定义参数绑定 日期转换器
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {

    @Override
    public void addFormatters(FormatterRegistry registry) {
        // 注册
        registry.addConverter(new StringToDateConverter());
    }
}
